﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using core;

namespace comix
{
    public class Categories : SiteItemSingle, ISiteItemMember
    {
        protected string m_name;

        public Categories()
        {
            m_com.CommandText = "SELECT * FROM Categories WHERE cat_id = @cat_id";
        }

        public override void DoFill(System.Data.SqlClient.SqlDataReader rdr)
        {
            Id = (int)rdr["cat_id"];
            m_name = (string)rdr["cat_name"];
        }

        public override void SetSelectParameters()
        {
            m_com.Parameters.Clear();
            m_com.Parameters.Add(new System.Data.SqlClient.SqlParameter("@cat_id", Id));
        }

        #region ISiteItemMember Members

        public void FillMember(System.Data.SqlClient.SqlDataReader rdr)
        {
            Id = (int)rdr["cat_id"];
            m_name = (string)rdr["cat_name"];
        }

        #endregion
    }
}
